﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
using ClassLibrarySample;

namespace EightballService
{
    class Program
    {
        static void Main(string[] args)
        {
            TcpListener socket = new TcpListener(IPAddress.Any, 21);
            socket.Start();

            TcpClient client;

            while (true)
            {
                client = socket.AcceptTcpClient();
                NetworkStream stream = client.GetStream();
                EightBall eightBall = new EightBall();
                eightBall.Shake();
                byte[] data = Encoding.ASCII.GetBytes(eightBall.Message);
                stream.Write(data, 0, data.Length);
            }
        }
    }
}
